﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="SellingSlip.aspx.cs" Inherits="BillingManagment.SellingSlip" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="Scripts/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.ui.core.js" type="text/javascript"></script>
    <script src="Scripts/jquery.ui.datepicker.js" type="text/javascript"></script>
    <script src="Scripts/jquery.ui.widget.js" type="text/javascript"></script>
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1 style="text-align: center">
        ENTER SELLING DETAIL</h1>
    <table class="style1">
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblFarmer" runat="server" Text="Farmer Name"></asp:Label>
            </td>
            <td>
                &nbsp;
                <asp:DropDownList ID="ddlFarmerList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlFarmerList_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="rfv11" runat="server" InitialValue="0" Display="Dynamic"
                    ControlToValidate="ddlFarmerList" ValidationGroup="normal" Text="*" ForeColor="Red"
                    ErrorMessage="Select farmer."></asp:RequiredFieldValidator>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:TextBox ID="txtDate" runat="server" AutoPostBack="true" ReadOnly="false" OnTextChanged="txtDate_TextChanged"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfv12" runat="server" Display="Dynamic" ControlToValidate="txtDate"
                    ValidationGroup="normal" Text="*" ForeColor="Red" ErrorMessage="Select date."></asp:RequiredFieldValidator>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
                <asp:Label ID="lblReceivedBucket" runat="server" Text="Received Bucket"></asp:Label>
            </td>
            <td>
                &nbsp;
                <asp:TextBox ID="txtBucket" ReadOnly="true" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfv13" runat="server" Display="Dynamic" ControlToValidate="txtBucket"
                    ValidationGroup="normal" Text="*" ForeColor="Red" ErrorMessage="Enter received bucket."></asp:RequiredFieldValidator>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="6">
                <asp:GridView ID="GridView1" runat="server" Width="750px" AutoGenerateColumns="false"
                    Font-Names="Arial" Font-Size="11pt" AlternatingRowStyle-BackColor="#C2D69B" HeaderStyle-BackColor="green"
                    AllowPaging="true" ShowFooter="true" OnRowEditing="EditCustomer" OnRowUpdating="UpdateCustomer"
                    OnRowCancelingEdit="CancelEdit" PageSize="10">
                    <Columns>
                        <asp:TemplateField ItemStyle-Width="30px" HeaderText="S.No">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="100px" HeaderText="Product">
                            <ItemTemplate>
                                <asp:Label ID="lblProduct" runat="server" Text="Gud Balti"></asp:Label>
                                <asp:Label ID="lblCustomerID" runat="server" Text='<%# Eval("S_ID") %>' Visible="false"></asp:Label>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:Label ID="lblProduct" runat="server"></asp:Label>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="100px" HeaderText="No Of Bucket">
                            <ItemTemplate>
                                <asp:Label ID="lblBucket" runat="server" Text='<%# Eval("NoOfBucket")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtBucket" runat="server" Text='<%# Eval("NoOfBucket")%>'></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="txtBucket" runat="server"></asp:TextBox>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="150px" HeaderText="Rate">
                            <ItemTemplate>
                                <asp:Label ID="lblRate" runat="server" Text='<%# Eval("Rate_Per_Forty")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtRate" runat="server" Text='<%# Eval("Rate_Per_Forty")%>'></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="txtRate" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="txtRate"
                                    ValidationGroup="group1" Display="None" ErrorMessage="Enter Rate."></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="rev1" runat="server" ControlToValidate="txtRate"
                                    ValidationExpression="^\d+(?:\.\d{0,2})?$" Display="None" ValidationGroup="group1"
                                    ErrorMessage="Enter amount in right format"></asp:RegularExpressionValidator>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="150px" HeaderText="Wait">
                            <ItemTemplate>
                                <asp:Label ID="lblWait" runat="server" Text='<%# Eval("Product_Wait")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtWait" runat="server" Text='<%# Eval("Product_Wait")%>'></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="txtWait" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfv2" runat="server" ControlToValidate="txtWait"
                                    ValidationGroup="group1" Display="None" ErrorMessage="Enter Wait."></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="rev2" runat="server" ControlToValidate="txtWait"
                                    ValidationExpression="^\d+(?:\.\d{0,2})?$" ValidationGroup="group1" Display="None"
                                    ErrorMessage="Enter wait in right format"></asp:RegularExpressionValidator>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="150px" HeaderText="Amount">
                            <ItemTemplate>
                                <asp:Label ID="lblAmount" runat="server" Text='<%# Eval("Total_Amount")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtAmount" Enabled="false" runat="server" Text='<%# Eval("Total_Amount")%>'></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkRemove" runat="server" CommandArgument='<%# Eval("S_ID")%>'
                                    OnClientClick="return confirm('Do you want to delete?')" Text="Delete" OnClick="DeleteCustomer"></asp:LinkButton>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:Button ID="btnAdd" ValidationGroup="group1" runat="server" Text="Add" OnClick="AddNewCustomer" />
                                <asp:ValidationSummary ValidationGroup="group1" ID="ValidationSummary1" ShowMessageBox="true"
                                    ShowSummary="false" runat="server" />
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:CommandField ShowEditButton="True" />
                    </Columns>
                    <AlternatingRowStyle BackColor="#C2D69B" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:HiddenField ID="hdnTotalBucket" runat="server" />
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblProductionCost" runat="server" Text="Product Cost"></asp:Label>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:TextBox ID="txtProductCost" runat="server"></asp:TextBox>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblLabourCharge" runat="server" Text="Labour Charge"></asp:Label>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:TextBox ID="txtLabourCharge" runat="server"></asp:TextBox>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblTotal" runat="server" Text="Total"></asp:Label>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:TextBox ID="txtTotal" runat="server"></asp:TextBox>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" ValidationGroup="normal"
                    Width="149px" OnClick="btnSubmit_Click" />
                <asp:ValidationSummary ID="ValidationSummary2" ShowMessageBox="true" ShowSummary="false"
                    ValidationGroup="normal" runat="server" />
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="152px" />
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        $(function () {
            $("#ContentPlaceHolder1_txtDate").datepicker({ dateFormat: 'dd-mm-yy' }).val();


        });
    </script>
</asp:Content>
